//
//  WeChatQQSerialize.h
//  WeChatQQStaticLib
//
//  Created by mac on 16/12/21.
//  Copyright © 2016年 srulos. All rights reserved.
//

#ifndef WeChatQQSerialize_h
#define WeChatQQSerialize_h

#define DECLEAR_POST_CB_FUNC(_func_name)\
-(void)_func_name:(WQHttpResult *)result backCode:(id)backCode;

#define DECLEAR_GETDATA_CB_FUNC(_func_name)\
-(void)_func_name:(NSData *)data backCode:(id)backCode;

#define POST_STRING(_url,_param,_delegate,_selector,_backCode)\
[[WQComplexHttpHelper standard]post:[NSString stringWithFormat:@"%@",_url] param:_param delegate:_delegate selector:_selector backCode:_backCode];

#define POST_STRING_REQUEST(_request,_delegate,_selector,_backCode)\
[[WQComplexHttpHelper standard]post:_request delegate:_delegate selector:_selector backCode:_backCode];

#define GET_DATA(_url,_delegate,_selector,_backCode)\
[[WQComplexHttpHelper standard] downLoadData:_url delegate:_delegate selector:_selector backCode:_backCode];

#define GET_CACHE_IMAGE_HTTP(_httpUrl,_imageView)\
[[WQCacheManager standard] getImage:_httpUrl imageView:_imageView scale:1.0];

#define GET_CACHE_IMAGE_HTTP_SCALE_CALL_BACK(_httpUrl,_imageView,_scale,_delegate,_selector,_backCode)\
[[WQCacheManager standard] getImage:_httpUrl imageView:_imageView scale:_scale delegate:_delegate selector:_selector backCode:_backCode];

#define GET_CACHE_IMAGE_HTTP_SCALE(_httpUrl,_imageView,_scale)\
[[WQCacheManager standard] getImage:_httpUrl imageView:_imageView scale:_scale];

#define GET_CACHE_DATA(_url,_delegate,_selector,_backCode)\
[[WQCacheManager standard] getData:_url delegate:_delegate selector:_selector backCode:_backCode];

#define ADD_OBSERVER(_id,_sel,_notificationName,_object)\
[[WQNotificationManager stander]addObserver:_id selector:_sel name:_notificationName object:_object];

#define REMOVE_OBSERVER(_id,_notificationName,_object)\
//[[NSNotificationCenter defaultCenter]removeObserver:_id name:_notificationName object:_object];

#define POST_NOTIFICATION(_notificationName,_object)\
[[WQNotificationManager stander]postNotification:_notificationName object:_object];

#define Nil2EmptyString(condition)\
if (condition == nil) {\
condition = @"";\
}

/* notification */
#define NOTIFICATION_WECHAT_USER_LOGIN_SUCCESS @"notification_wechat_user_login_success"
#define NOTIFICATION_WECHAT_NEW_SYNC_KEY @"notification_wechat_new_sync_key"
#define NOTIFICATION_WECHAT_OFFLINE @"notification_wechat_offline"
#define NOTIFICATION_WECHAT_WXINITED @"notification_wechat_wxinited"

#define NOTIFICATION_QQ_USER_LOGIN_SUCCESS @"notification_qq_user_login_success"
#define NOTIFICATION_QQ_INITED @"notification_qq_inited"
#define NOTIFICATION_QQ_SCRIPT_LOADED @"notification_qq_script_loaded"

#define NOTIFICATION_MP_LOGIN_SUCCESS @"notification_mp_login_success"

#define NOTIFICATION_APP_INFO_LOADED @"notification_app_info_loaded"

#endif /* WeChatQQSerialize_h */
